package com.heima.comment.controller;

import com.heima.comment.service.CommentManageService;
import com.heima.comment.service.CommentService;
import com.heima.model.common.dtos.comment.CommentDto;
import com.heima.model.common.dtos.comment.CommentPageDto;
import com.heima.model.common.dtos.common.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/comment/manage")
public class CommentManageController {
    @Autowired
    private CommentManageService commentManageService;

    /**
     * 分页显示
     * @param commentPageDto
     * @return
     */
    @PostMapping("/find_news_comments")
    public ResponseResult findNewComments(@RequestBody CommentPageDto commentPageDto) {
       return commentManageService.findAll(commentPageDto);
    }
}
